#pragma once

// 双目相机
#include "base_component.h"

class StereoCamera : public BaseComponent {
public:
    StereoCamera();
    void print() override;
    int save(YAML::Node& node) override;
    int setCameraModel(std::string model);
    void setCameraType(std::string type);
    void setResolution(int width, int height);
    void setRGBFrameRate(int frameRate);
    void setFOV(int width, int height);
    void setDepthFrameRate(int frameRate);

private:
    std::string _cameraModel;
    std::string _cameraType;
    int _resolutionWidth;
    int _resolutionHeight;
    int _rgbFrameRate;
    int _fovWidth;
    int _fovHeight;
    int _depthFrameRate;
};

namespace YAML {
template <>
struct convert<StereoCamera> {
    static bool decode(const Node& node, StereoCamera& rhs) {
        rhs.setCameraModel(node["cameraModel"].as<std::string>());
        rhs.setCameraType(node["cameraType"].as<std::string>());
        rhs.setResolution(node["resolutionWidth"].as<int>(), node["resolutionHeight"].as<int>());
        rhs.setRGBFrameRate(node["rgbFrameRate"].as<int>());
        rhs.setFOV(node["fovWidth"].as<int>(), node["fovHeight"].as<int>());
        rhs.setDepthFrameRate(node["depthFrameRate"].as<int>());
        return true;
    }
};
}  // namespace YAML
